package net.studou.service;

import java.util.List;

import javax.annotation.Resource;

import net.studou.dao.PopedomDao;
import net.studou.po.Popedom;

import org.springframework.stereotype.Component;

@Component("popedomService")
public class PopedomService {

	@Resource(name = "popedomDao")
	private PopedomDao popedomDao;

	@SuppressWarnings("unchecked")
	public Popedom getPopedomByCode(String popedomCode) {
		Popedom popedom = null;
		List list = popedomDao.findByProperty("popedomCode", popedomCode);
		if(list != null && list.size() > 0){
			popedom = (Popedom) list.get(0);
		}
		return popedom;
	}
}
